Skip to content

Add support for vApplicationFPUSafeIRQHandler#1113

Merged
aggarg merged 1 commit into
FreeRTOS:mainfrom
kar-rahul-aws:update_CRx_No_GIC_port
Aug 8, 2024
Merged

Add support for vApplicationFPUSafeIRQHandler#1113
aggarg merged 1 commit into
FreeRTOS:mainfrom
kar-rahul-aws:update_CRx_No_GIC_port

Conversation

@kar-rahul-aws

@kar-rahul-aws kar-rahul-aws commented Aug 7, 2024

Copy link
Copy Markdown
Contributor

Description

This PR adds support for vApplicationFPUSafeIRQHandler. The application writer needs to name their IRQ handler as:

  1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
  2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default implementation of vApplicationIRQHandler is used which stores FPU registers and then calls vApplicationFPUSafeIRQHandler.

Test Steps

Tested on ARM_CRx_No_GIC Demo with the code snippet

    __asm volatile ( "vmov d8, r0, r1       \n"
                     "vmov d9, r0, r1       \n"
                     "vmov d10, r0, r1      \n"
                     "vmov d11, r0, r1      \n"
                     "vmov d12, r0, r1      \n"
                     "vmov d13, r0, r1      \n"
                     "vmov d14, r0, r1      \n"
                     "vmov d15, r0, r1      \n"
                     ::: "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15" );

    __asm volatile ( "vmov d0, r0, r1       \n"
                     "vmov d1, r0, r1       \n"
                     "vmov d2, r0, r1       \n"
                     "vmov d3, r0, r1       \n"
                     "vmov d4, r0, r1       \n"
                     "vmov d5, r0, r1       \n"
                     "vmov d6, r0, r1       \n"
                     "vmov d7, r0, r1       \n"
                     ::: "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7" );

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kar-rahul-aws kar-rahul-aws requested a review from a team as a code owner August 7, 2024 16:32
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2024

Copy link
Copy Markdown

@aggarg aggarg changed the title Store FPU registers {D0-D7} in IRQ_Handler Add support for vApplicationFPUSafeIRQHandler Aug 7, 2024
@codecov

codecov Bot commented Aug 7, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.31%. Comparing base (17dfd0f) to head (171129a).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1113   +/-   ##
=======================================
  Coverage   92.31%   92.31%           
=======================================
  Files           6        6           
  Lines        3226     3228    +2     
  Branches      885      885           
=======================================
+ Hits         2978     2980    +2     
  Misses        132      132           
  Partials      116      116           
Flag Coverage Δ
unittests 92.31% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aggarg aggarg merged commit c963d24 into FreeRTOS:main Aug 8, 2024
@aggarg aggarg deleted the update_CRx_No_GIC_port branch August 8, 2024 15:37
asellaminxp pushed a commit to nxp-mcuxpresso/FreeRTOS-Kernel that referenced this pull request Nov 28, 2024
The application writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

Note that recent versions of GCC may use FP/SIMD registers to optimize 16-bytes
copy and especially when using va_start()/va_arg() functions (e.g printing some thing
in IRQ handlers may trigger usage of FPU registers)

This implementation is heavily inspired by both the ARM_CA9 port and the ARM_CRx_No_GIC
port done in [1]

[1] FreeRTOS#1113

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
asellaminxp pushed a commit to nxp-mcuxpresso/FreeRTOS-Kernel that referenced this pull request Jan 22, 2025
The application writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

Note that recent versions of GCC may use FP/SIMD registers to optimize 16-bytes
copy and especially when using va_start()/va_arg() functions (e.g printing some thing
in IRQ handlers may trigger usage of FPU registers)

This implementation is heavily inspired by both the ARM_CA9 port and the ARM_CRx_No_GIC
port done in [1]

[1] FreeRTOS#1113

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
asellaminxp pushed a commit to nxp-mcuxpresso/FreeRTOS-Kernel that referenced this pull request Jan 22, 2025
The application writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

Note that recent versions of GCC may use FP/SIMD registers to optimize 16-bytes
copy and especially when using va_start()/va_arg() functions (e.g printing some thing
in IRQ handlers may trigger usage of FPU registers)

This implementation is heavily inspired by both the ARM_CA9 port and the ARM_CRx_No_GIC
port done in [1]

[1] FreeRTOS#1113

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
archigup pushed a commit that referenced this pull request Jan 23, 2025
The application writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

Note that recent versions of GCC may use FP/SIMD registers to optimize 16-bytes
copy and especially when using va_start()/va_arg() functions (e.g printing some thing
in IRQ handlers may trigger usage of FPU registers)

This implementation is heavily inspired by both the ARM_CA9 port and the ARM_CRx_No_GIC
port done in [1]

[1] #1113

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
MinghuanLian pushed a commit to nxp-mcuxpresso/FreeRTOS-Kernel that referenced this pull request Nov 26, 2025
The application writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

Note that recent versions of GCC may use FP/SIMD registers to optimize 16-bytes
copy and especially when using va_start()/va_arg() functions (e.g printing some thing
in IRQ handlers may trigger usage of FPU registers)

This implementation is heavily inspired by both the ARM_CA9 port and the ARM_CRx_No_GIC
port done in [1]

[1] FreeRTOS#1113

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants